<!---
@自动生成 BY Kupe框架 www.kupebank.com
#date : 2018-03-04 09:21:05
#path : app/template/admin/news.addmode.html
--->
<form class="layui-form" action="" style="padding:10px;width:450px;height:350px;">

  <div class="layui-form-item">
    <label class="layui-form-label">导航名称</label>
    <div class="layui-input-block">
      <input type="text" name="name" required  lay-verify="required" placeholder="请输入导航名称" autocomplete="off" class="layui-input">
    </div>
  </div>
  

  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">导航类型</label>
    <div class="layui-input-block">	
		{html_select name="type" options=$type default="请选择..." value=$rt.type2 other='lay-filter="type" lay-verify="required"  '}      
    </div>
  </div>

  <div class="layui-form-item layui-form-text form2">

  </div>



 

  <div class="layui-form-item">
    <label class="layui-form-label">  排序 </label>
    <div class="layui-input-block">
      <input type="text" name="porder" value="" required  lay-verify="number" placeholder="请输入作者" autocomplete="off" class="layui-input">
    </div>
  </div>



  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
<input type="hidden" value="" name="id">
</form>
 
<script>
formSubmit('{_url m="doeditnav"}','formDemo','reload');


layui.use(['element', 'table','form','layer','laypage', 'layedit','upload'], function(){
  var element = layui.element,
  $ = layui.jquery,
  form = layui.form,
  element = layui.element,
  layer = layui.layer;

  form.on('select(type)', function(data){
	  url = '{_url m="addnav" ajax=1}&type=' + data.value;
	  $.get(url,function(data){
		  $('.form2').html(data);	
		  form.render('select'); 
	  });
	  
	});

	 url = '{_url m="addnav" ajax=1}&type='+$('[name="type"] :selected').val() + "&category_id={$rt.category_id}&news_id={$rt.news_id}&url={$rt.url}";
	 $.get(url,function(data){
		  $('.form2').html(data);	
		  form.render('select'); 
	  });


});

</script>

<script>
/*编辑专用*/
$(function(){
	{foreach $rt as $k => $v}
		$("input[name='{$k}'][type='text'],input[name='{$k}'][type='hidden']").val("{$v}");
	{/foreach}	
	//$("input[name='status']").val("1");
});
</script>